package BandB.Tool.GPhoneManager;

import android.content.Context;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.TextView;

public class ConfigerAdapter extends BaseAdapter {
	private final LayoutInflater nInflater;
	private final Context mContext;
	
	private final String[] configerStrings = { "GM-QuickLauncher",
			"Toggles-onoff", "WIFI-onoff", "Brightness-onoff",
			"AirplaneMode-onoff", "SilentMode-onoff" };

	public static int[] ImageID ={
			R.drawable.icon,R.drawable.toogles,R.drawable.wifi3,R.drawable.brightness,
			R.drawable.airplane3,R.drawable.sound3
	};

	public ConfigerAdapter(Context c) {
		Log.v("ok", "CurrencyAdapter...");
		mContext = c;
		nInflater = (LayoutInflater)c.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
	}

	public int getCount() {
		// TODO Auto-generated method stub
		return configerStrings.length;
	}

	public Object getItem(int position) {
		// TODO Auto-generated method stub
		return configerStrings[position];
	}

	public long getItemId(int position) {
		// TODO Auto-generated method stub
		return position;
	}

	public View getView(int position, View convertView, ViewGroup parent) {
		// TODO Auto-generated method stub
		// return null;
		if (convertView == null) {
			convertView = nInflater.inflate(R.layout.configerlist_item ,parent, false);
			TextView txtView = (TextView)convertView.findViewById(R.id.configername);
			ImageView imgView = (ImageView)convertView.findViewById(R.id.configerimage);
			txtView.setText(configerStrings[position]);
			imgView.setImageResource(ImageID[position]);
		} else {
			TextView txtView = (TextView)convertView.findViewById(R.id.configername);
			ImageView imgView = (ImageView)convertView.findViewById(R.id.configerimage);
			txtView.setText(configerStrings[position]);
			imgView.setImageResource(ImageID[position]);
		}
		return convertView;
	}
}
